
import matplotlib.pyplot as plt
score = [100,45,78,98,65,54,87,54,24,58,57,54,75
         ,54,21,32,54,78,98,65,78,87,98,89,78,54
         ,54,87,87,98,69,87,78,79,49,69,98,89,78]
plt.rcParams['font.sans-serif']=['SimHei']
plt.xlabel('分数')
plt.ylabel('学生数量')
plt.title('学生数学成绩分布直方图')
plt.hist(score, bins=range(0, 150, 10), facecolor='blue', edgecolor='red')
plt.show()